#define MODE_NUMBER

matrix
	//This is where the Data is stored, sadly numeric vars only seem to cover 16 bit, so we need a list...
	//More investigation neede tough
	//UPDATE: Actually BYOND uses 32bit float numbers -> we have 24 precise bits, we could use 31 or 32 tough eventually, since we work with bitflags

	//This is meant to store the whole matrix in a single number limiting the dimensionst to x*y < 32

	var/number
	var/rows
	var/columns

	//Constructor for Zero/One Matrix
	New(w as num, h as num, val as num){
		for(var/i = 0, i < w*h, i++){
			number *= 2
			number += val
		}
		src.columns = w
		src.rows = h
	}

	proc/print(){
		world << "Matrix:\ncolumns:	[columns],	rows:	[rows]"
		var/str
		for(var/i = 0, i < src.rows, i++){
			for(var/j = 0, j < src.columns, j++){
				str = "[src.number] & 1" + str
			}
			str = "\n" + str
		}
		world << str
	}

	proc/invertBits(){
		//world << src.bitrow.len
		for(var/i = 0, i < rows, i++){
			//Arrays in this language are kindof strange...
			src.number = !src.number	//invert the bits!
		}
	}

	proc/and(var/matrix/M){
		//security check
		if(src.rows == M.rows && src.columns == M.columns){

			var/matrix/R = new/matrix(src.columns,src.rows,FALSE)

			//AND'ed and set
			R.number = (src.number & M.number)

			return R

		}else{
			world << "ERROR: Matrices are not of the same dimensions."
		}

	}